Do any preferences need to be set in order to use LMouser ?
LMouser is a mix-in class for use with Metrowerks PowerPlant. It is designed to call the MouseEnter(), MouseLeave() and MouseWithin() methods of the LPane class.
Using LMouser is simple - just include it in the list of inherited classes and override the appropriate methods. LMouser only has the default constructor, so there is no need to include it in the initialiser list.
Failing to override one of the methods simply means that the default behaviour (nothing) will be used.
class CMyMouser : public LPane, public LMouser { public: CMyMouser (void ); ~CMyMouser (void ); virtual void MouseEnter (Point inPortPt, const EventRecord &inMacEvent ); virtual void MouseLeave (void ); virtual void MouseWithin(Point inPortPt, const EventRecord &inMacEvent ); };
Do any preferences need to be set in order to use LMouser ?
LMouser requires RTTI to be enabled. LMouser makes extensive use of RTTI - it cannot function without it. RTTI is needed because the code needs to be able to determine if a particular pane is an LMouser or not, as well as to get the correct memory address when dealing with multiple inheritance.
The current version will generate a compile-time error if RTTI is not enabled for every file which includes "LMouser.h". This error is generated with the code
#if !__option(RTTI) #error LMouser requires RTTI to be enabled #endif
Versions prior to 2.0 will compile with a warning for each call to dynamic_cast.
Version 2.0 will compile without any errors or warnings - this should be considered a bug.
Make LMouser virtually inherit from LPane so I can get rid of RTTI. This should work as all LMousers must also be an LPane for anything to happen.
Make LMouseDispatcher a friend class to LMouser and stop it being a subclass of LMouser. It really shouldn't be after all.
2.2
Discovered that LView::FindDeepSubMouserContaining() would return an invisible pane, preventing an LMouser behind it from receiving any events. I found this one all by myselfhttp://www.zip.com.au/~delaney. A new function LMouser::FindVisibleDeepSubPaneContaining() is now part of the package.
Note: An inactive or disabled pane covering an LMouser should prevent the LMouser from receiving events.
2.1
Fixed a logical error which got introduced somewhere after 1.0: only LMousers in the active window would respond. This has been removed. Thanks to Daniel Sears, sears@netcom.com for pointing this out.
2.0
Fixed a bug which could result in a crash if the mouse is inside a mouser when that mouser is destroyed. This might account for a number of crashes I was getting in my other code. Thanks Bill Hubauer, hubauer@telerama.lm.com.
Made LMouseDispatcher internal to "LMouser.cp" (and hence invisible to the rest of the world). LMouseDispatcher now inherits from LPeriodical and installs an instance of itself as a repeater with StartRepeating(). As a side effect, LMousers are now dealt with after events are dispatched (when AdjustCursor() in the application class was being overridden they were being dealt with beforehand). The application class now no longer (and indeed cannot) inherit from LMouseDispatcher.
1.1
Split LMouser into two classes: LMouser and LMouseDispatcher. The application class is to inherit from LMouseDispatcher. Used, but never released.
1.0
First release.
LMouser is © 1996 Boxes Objects Links Design Pty Ltd. All Rights Reserved. You use this software at your own risk, etc. Permission is given to Timothy C. Delaney to use LMouser. Permission is given for all others to use LMouser if acknowledgement of this copyright is given in publically-released software. Acknowledgement should consist of a statement equivalent to "Sections of this program are © Boxes Objects Links Design Pty Ltd", visible in an "About..." box or splash screen.